package com.lzl.servicedriveruser.service;


import com.lzl.dto.Car;
import com.lzl.responese.ResponseResult;
import com.lzl.servicedriveruser.mapper.CarMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lzl
 * @since 2022-09-04
 */
@Service
public class CarServiceImpl {

    @Autowired
    CarMapper carMapper;

    public ResponseResult addCar(Car car) {
        LocalDateTime now = LocalDateTime.now();
        car.setGmtCreate(now);
        car.setGmtModified(now);
        carMapper.insert(car);
        return ResponseResult.success("车辆信息插入成功");
    }

}
